package com.fk.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.fk.dao.impl.XinWenXiangQingDaoImpl;
import com.fk.entity.XinWenXiangQing;


public class NewSDetail extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//鎺ュ彈鍓嶅彴浼犳潵鐨勫弬鏁�
		int gId=Integer.parseInt(request.getParameter("xinWenNeiRongId"));
		XinWenXiangQingDaoImpl xwxqDao=new XinWenXiangQingDaoImpl();
		List<XinWenXiangQing> xwxqErList=xwxqDao.getxwxqList(gId);
		request.setAttribute("xwxqErList", xwxqErList);//瀛�
		//上一条新闻
				//接受前台传来的参数
				int sId=Integer.parseInt(request.getParameter("xinWenNeiRongId"));
				XinWenXiangQingDaoImpl shangDao=new XinWenXiangQingDaoImpl();
				List<XinWenXiangQing> shangList=xwxqDao.getShangYiTiaoList(sId);
				request.setAttribute("shangList", shangList);//存
				
				
				//下一条新闻
				//接受前台传来的参数
				int xId=Integer.parseInt(request.getParameter("xinWenNeiRongId"));
				XinWenXiangQingDaoImpl xiaDao=new XinWenXiangQingDaoImpl();
				List<XinWenXiangQing> xiaList=xiaDao.getXiaYiTiaoList(xId);
				request.setAttribute("xiaList", xiaList);//存
		
				
		request.getRequestDispatcher("article_list_content.jsp").forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
